package com.kun.portal.webframe.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.kun.portal.webframe.util.Loaded;
import com.kun.portal.webframe.util.Status;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import  java.util.Date;

/**
 * Created by Administrator on 2018/4/25.
 */
@Entity
@Table(
        name = "fbo_appointment"
)
@DynamicUpdate
public class AppointmentPo implements Serializable {
    public String getAppoId() {
        return appoId;
    }

    public void setAppoId(String appoId) {
        this.appoId = appoId;
    }

    public String getAppoUnit() {
        return appoUnit;
    }

    public void setAppoUnit(String appoUnit) {
        this.appoUnit = appoUnit;
    }

    public String getAppoName() {
        return appoName;
    }

    public void setAppoName(String appoName) {
        this.appoName = appoName;
    }

    @Id
    @GeneratedValue(
            generator = "appo_id"
    )

    @GenericGenerator(
            name = "appo_id",
            strategy = "uuid"
    )
    @Column(
            name = "appo_id",
            length = 32,
            nullable = false
    )

    private String appoId;
    @Column(
            name = "appo_unit",
            length = 100
    )
    private String appoUnit;

    @Column(
            name = "appo_name",
            length = 20
    )
    private String appoName;

    @Column(
            name = "plane_property",
            length = 30
    )

    private String planeProperty;//航班性质

    @Column(
            name = "estimated_time"
    )
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="Asia/Shanghai")
    @Temporal(TemporalType.DATE)
    private Date estimatedTime;//预计安排时间

    public String getIsDispatch() {
        return isDispatch;
    }

    public void setIsDispatch(String isDispatch) {
        this.isDispatch = isDispatch;
    }

    @Column(
            name = "is_dispatch",
            length = 20
    )
    private String isDispatch ;//是否已派发车辆

    public String getAppoPhoneNum() {
        return appoPhoneNum;
    }

    public void setAppoPhoneNum(String appoPhoneNum) {
        this.appoPhoneNum = appoPhoneNum;
    }

    public String getAppoEmil() {
        return appoEmil;
    }

    public void setAppoEmil(String appoEmil) {
        this.appoEmil = appoEmil;
    }

    public String getFlightProperty() {
        return flightProperty;
    }

    public void setFlightProperty(String flightProperty) {
        this.flightProperty = flightProperty;
    }

    public String getFlightNum() {
        return flightNum;
    }

    public void setFlightNum(String flightNum) {
        this.flightNum = flightNum;
    }



    public String getAppProperty() {
        return appProperty;
    }

    public void setAppProperty(String appProperty) {
        this.appProperty = appProperty;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }



    public boolean isHasPersonNum() {
        return hasPersonNum;
    }

    public void setHasPersonNum(boolean hasPersonNum) {
        this.hasPersonNum = hasPersonNum;
    }

    public String getPersonNum() {
        return personNum;
    }

    public void setPersonNum(String personNum) {
        this.personNum = personNum;
    }

    @Column(
            name = "appo_phone_num",
            length = 20
    )
    private String appoPhoneNum;//预约电话
    @Column(
            name = "appo_emil",
            length = 50
    )

    private String appoEmil;

    @Column(
            name = "flight_property",
            length = 30
    )
    private String flightProperty;

    @OneToOne(targetEntity = FlightPlanePo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "plane_id",referencedColumnName = "plane_id")

    private  FlightPlanePo flightPlane;

    @OneToOne(targetEntity = FlightPlanePo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "pre_plane_id",referencedColumnName = "plane_id")

    private  FlightPlanePo preFlightPlane;

    @OneToOne(targetEntity = FlightInfoPo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "flight_info_id",referencedColumnName = "flight_info_id")
    private FlightInfoPo flightInfo;
    @Column(
            name = "flight_num",
            length = 30
    )
    private String  flightNum
            ;
    @DateTimeFormat(pattern="yyyy-MM-dd HH")
    @JsonFormat(pattern="yyyy-MM-dd HH",timezone="Asia/Shanghai")
    @Temporal(TemporalType.TIMESTAMP)
    @Column(
            name = "appo_date"
    )

    private Date appoDate;


    public Date getAppoDate() {
        return appoDate;
    }

    public void setAppoDate(Date appoDate) {
        this.appoDate = appoDate;
    }

    @Column(
            name = "app_property",
            length = 10
    )
    private String appProperty;

    @Column(
            name = "destination",
            length = 50
    )
    private String  destination;

    public String getOriginating() {
        return originating;
    }

    public void setOriginating(String originating) {
        this.originating = originating;
    }

    @Column(
            name = "originating",
            length = 50
    )
    private String  originating;

    public ContractManagePo getAgreement() {
        return agreement;
    }

    public void setAgreement(ContractManagePo agreement) {
        this.agreement = agreement;
    }

    @OneToOne(targetEntity =ContractManagePo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "contract_manage_id",referencedColumnName = "contract_manage_id")
    private ContractManagePo agreement;
    @Column(
            name = "has_person_num"
    )
    private boolean hasPersonNum;

    @Column(
            name = "person_num",
            length = 10
    )
    private String personNum;

    public boolean isHasContactInfo() {
        return hasContactInfo;
    }

    public void setHasContactInfo(boolean hasContactInfo) {
        this.hasContactInfo = hasContactInfo;
    }

    @Column(
            name = "has_contact_info"
    )

    private boolean hasContactInfo;
    @Column(
            name = "contact_name",
            length = 50
    )
    private String contactName;//联络人

    @Column(
            name = "contact_phone_num",
            length = 20
    )
    private String contactPhoneNum;//联系电话

    @Column(
            name = "need_car"
    )
    private boolean needCar;

    @Column(
            name = "address",
            length = 50
    )
    private String address ;//接送地址

    @Column(
            name = "pick_up_num",
            length = 50
    )
    private Integer pickUpNum;//接送人数

    public Integer getPickUpNum() {
        return pickUpNum;
    }

    public void setPickUpNum(Integer pickUpNum) {
        this.pickUpNum = pickUpNum;
    }

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    public Date getPickUpTime() {
        return pickUpTime;
    }

    public void setPickUpTime(Date pickUpTime) {
        this.pickUpTime = pickUpTime;
    }

    @Column(
            name = "pick_up_time",
            length = 50
    )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date pickUpTime;//接送时间

    @OneToOne(targetEntity =VehicleDispatchPo.class,cascade = CascadeType.DETACH)
    @JoinColumn(name = "vehicle_dispatch_id",referencedColumnName = "dispatch_id")
    private VehicleDispatchPo vehicleDispatch;

    public VehicleDispatchPo getVehicleDispatch() {
        return vehicleDispatch;
    }

    public void setVehicleDispatch(VehicleDispatchPo vehicleDispatch) {
        this.vehicleDispatch = vehicleDispatch;
    }

    @Column(
            name = "need_ferry_push"
    )
    private boolean needFerryPush;

    @Column(
            name = "ferry_pushre_marks",
            length = 100
    )
    private String ferryPushreMarks;


    @Column(
            name = "need_exit_passageway"

    )
    private boolean needExitPassageway;

    @Column(
            name = "exit_passageway_marks",
            length = 100
    )
    private String exitPassagewayMarks;

    @Column(
            name = "need_baggage_handling"

    )
    private boolean needBaggageHandling;
    @Column(
            name = "baggage_handling_mark",
            length = 100
    )
    private String  baggageHandlingMark;

    @Column(
            name = "need_guide"
    )
    private  boolean needGuide;

    @Column(
            name = "guide_mark",
            length = 100
    )
    private String  guideMark;


    @Column(
            name = "need_corporate_aircraft_special_way"

    )
    private boolean needCorporateAircraftSpecialWay;


    @Column(
            name = "corporate_aircraft_special_way_mark",
            length = 100
    )
    private String  corporateAircraftSpecialWayMark;

    @Column(
            name = "need_car_to_apron"

    )
    private  boolean needCarToApron;
    @Column(
            name = "car_to_apron_mark",
            length = 100
    )
    private String carToApronMark;

    @Column(
            name = "need_customs_border_control",
            length = 100
    )
    private boolean needCustomsBorderControl;

    @Column(
            name = "customs_border_control",
            length = 100
    )
    private String customsBorderControl;

    @Column(
            name = "need_aircraft_special_service"

    )
    private boolean needAircraftSpecialService;

    @Column(
            name = "aircraft_special_service_mark",
            length = 100
    )
    private String  aircraftSpecialServiceMark;

    @Column(
            name = "need_aircraft_guide",
            length = 100
    )
    private boolean needAircraftGuide;

    @Column(
            name = "aircraft_guid_mark",
            length = 100
    )
    private String aircraftGuidMark;

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhoneNum() {
        return contactPhoneNum;
    }

    public void setContactPhoneNum(String contactPhoneNum) {
        this.contactPhoneNum = contactPhoneNum;
    }

    public boolean isNeedCar() {
        return needCar;
    }

    public void setNeedCar(boolean needCar) {
        this.needCar = needCar;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public boolean isNeedFerryPush() {
        return needFerryPush;
    }

    public void setNeedFerryPush(boolean needFerryPush) {
        this.needFerryPush = needFerryPush;
    }

    public String getFerryPushreMarks() {
        return ferryPushreMarks;
    }

    public void setFerryPushreMarks(String ferryPushreMarks) {
        this.ferryPushreMarks = ferryPushreMarks;
    }

    public boolean isNeedExitPassageway() {
        return needExitPassageway;
    }

    public void setNeedExitPassageway(boolean needExitPassageway) {
        this.needExitPassageway = needExitPassageway;
    }

    public String getExitPassagewayMarks() {
        return exitPassagewayMarks;
    }

    public void setExitPassagewayMarks(String exitPassagewayMarks) {
        this.exitPassagewayMarks = exitPassagewayMarks;
    }

    public boolean isNeedBaggageHandling() {
        return needBaggageHandling;
    }

    public void setNeedBaggageHandling(boolean needBaggageHandling) {
        this.needBaggageHandling = needBaggageHandling;
    }

    public String getBaggageHandlingMark() {
        return baggageHandlingMark;
    }

    public void setBaggageHandlingMark(String baggageHandlingMark) {
        this.baggageHandlingMark = baggageHandlingMark;
    }

    public boolean isNeedGuide() {
        return needGuide;
    }

    public void setNeedGuide(boolean needGuide) {
        this.needGuide = needGuide;
    }

    public String getGuideMark() {
        return guideMark;
    }

    public void setGuideMark(String guideMark) {
        this.guideMark = guideMark;
    }

    public boolean isNeedCorporateAircraftSpecialWay() {
        return needCorporateAircraftSpecialWay;
    }

    public void setNeedCorporateAircraftSpecialWay(boolean needCorporateAircraftSpecialWay) {
        this.needCorporateAircraftSpecialWay = needCorporateAircraftSpecialWay;
    }

    public String getCorporateAircraftSpecialWayMark() {
        return corporateAircraftSpecialWayMark;
    }

    public void setCorporateAircraftSpecialWayMark(String corporateAircraftSpecialWayMark) {
        this.corporateAircraftSpecialWayMark = corporateAircraftSpecialWayMark;
    }

    public boolean isNeedCarToApron() {
        return needCarToApron;
    }

    public void setNeedCarToApron(boolean needCarToApron) {
        this.needCarToApron = needCarToApron;
    }

    public String getCarToApronMark() {
        return carToApronMark;
    }

    public void setCarToApronMark(String carToApronMark) {
        this.carToApronMark = carToApronMark;
    }

    public boolean isNeedCustomsBorderControl() {
        return needCustomsBorderControl;
    }

    public void setNeedCustomsBorderControl(boolean needCustomsBorderControl) {
        this.needCustomsBorderControl = needCustomsBorderControl;
    }

    public String getCustomsBorderControl() {
        return customsBorderControl;
    }

    public void setCustomsBorderControl(String customsBorderControl) {
        this.customsBorderControl = customsBorderControl;
    }

    public boolean isNeedAircraftSpecialService() {
        return needAircraftSpecialService;
    }

    public void setNeedAircraftSpecialService(boolean needAircraftSpecialService) {
        this.needAircraftSpecialService = needAircraftSpecialService;
    }

    public String getAircraftSpecialServiceMark() {
        return aircraftSpecialServiceMark;
    }

    public void setAircraftSpecialServiceMark(String aircraftSpecialServiceMark) {
        this.aircraftSpecialServiceMark = aircraftSpecialServiceMark;
    }

    public boolean isNeedAircraftGuide() {
        return needAircraftGuide;
    }

    public void setNeedAircraftGuide(boolean needAircraftGuide) {
        this.needAircraftGuide = needAircraftGuide;
    }

    public String getAircraftGuidMark() {
        return aircraftGuidMark;
    }

    public void setAircraftGuidMark(String aircraftGuidMark) {
        this.aircraftGuidMark = aircraftGuidMark;
    }

    public boolean isNeedBusinessAircraftRoom() {
        return needBusinessAircraftRoom;
    }

    public void setNeedBusinessAircraftRoom(boolean needBusinessAircraftRoom) {
        this.needBusinessAircraftRoom = needBusinessAircraftRoom;
    }

    public String getBusinessAircraftRoomMark() {
        return businessAircraftRoomMark;
    }

    public void setBusinessAircraftRoomMark(String businessAircraftRoomMark) {
        this.businessAircraftRoomMark = businessAircraftRoomMark;
    }

    public boolean isNeedCivilAviationControlCommand() {
        return needCivilAviationControlCommand;
    }

    public void setNeedCivilAviationControlCommand(boolean needCivilAviationControlCommand) {
        this.needCivilAviationControlCommand = needCivilAviationControlCommand;
    }

    public String getCivilAviationControlCommandMark() {
        return civilAviationControlCommandMark;
    }

    public void setCivilAviationControlCommandMark(String civilAviationControlCommandMark) {
        this.civilAviationControlCommandMark = civilAviationControlCommandMark;
    }

    public boolean isNeedGasoline() {
        return needGasoline;
    }

    public void setNeedGasoline(boolean needGasoline) {
        this.needGasoline = needGasoline;
    }

    public String getGasolineMark() {
        return gasolineMark;
    }

    public void setGasolineMark(String gasolineMark) {
        this.gasolineMark = gasolineMark;
    }

    public boolean isNeedOther() {
        return needOther;
    }

    public void setNeedOther(boolean needOther) {
        this.needOther = needOther;
    }

    public String getOtherMark() {
        return otherMark;
    }

    public void setOtherMark(String otherMark) {
        this.otherMark = otherMark;
    }

    @Column(
            name = "need_business_aircraft_room",
            length = 100

    )
    private boolean needBusinessAircraftRoom;

    @Column(
            name = "business_aircraft_room_mark",
            length = 100
    )
    private String  businessAircraftRoomMark;

    @Column(
            name = "need_civil_aviation_control_command"
    )
    private boolean needCivilAviationControlCommand;

    @Column(
            name = "civil_aviation_control_command_mark",
            length = 100
    )
    private String  civilAviationControlCommandMark;

    @Column(
            name = "need_gasoline"
    )
    private boolean needGasoline;

    @Column(
            name = "gasoline_mark",
            length = 100
    )
    private String  gasolineMark;

    @Column(
            name = "need_other"
    )
    private boolean needOther;

    @Column(
            name = "other_mark",
            length = 100
    )
    private String  otherMark;

    public FwUserPo getExaminePerson() {
        return (FwUserPo) Loaded.loaded(examinePerson);
    }

    public void setExaminePerson(FwUserPo examinePerson) {
        this.examinePerson = examinePerson;
    }

    public FwUserPo getEnterPerson() {
        return (FwUserPo) Loaded.loaded(enterPerson);
    }

    public void setEnterPerson(FwUserPo enterPerson) {
        this.enterPerson = enterPerson;
    }

    public FwUserPo getUpdatePerson() {
        return (FwUserPo) Loaded.loaded(updatePerson);
    }

    public void setUpdatePerson(FwUserPo updatePerson) {
        this.updatePerson = updatePerson;
    }

    @OneToOne(targetEntity = FwUserPo.class,cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "examine_user_id",referencedColumnName = "user_id")

    private FwUserPo  examinePerson;

    public Date getExamineDate() {
        return examineDate;
    }

    public void setExamineDate(Date examineDate) {
        this.examineDate = examineDate;
    }
    public Date getEnterDate() {
        return enterDate;
    }

    public void setEnterDate(Date enterDate) {
        this.enterDate = enterDate;
    }



    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Column(
            name = "examine_Date",
            length = 100
    )
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date  examineDate;

    @OneToOne(targetEntity = FwUserPo.class,cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "enter_user_id",referencedColumnName = "user_id")
    private FwUserPo  enterPerson;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @Column(
            name = "enter_Date",
            length = 100
    )
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date  enterDate;

    @OneToOne(targetEntity = FwUserPo.class,cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "update_user_id",referencedColumnName = "user_id")
    private FwUserPo  updatePerson;

    @Column(
            name = "update_Date",
            length = 100
    )
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date  updateDate;


    @Column(
            name = "status",
            length = 20
    )
    private String  status;

    @Column(
            name = "order_status"

    )
    private Integer  orderStatus = Status.NEW; //订单状态   cancle 取消  compleate 完成  发布 release  运行中 runing
    @Column(
            name = "effective"
    )

    private Boolean  effective =true; //是否取消

    @Column(
            name = "published"
    )
    private Boolean published = false;
    @Column(
            name = "has_transform_to_plane"
    )
    private Boolean  hasTransformToPlane =false;



    @OneToOne(targetEntity = SignInPo.class,cascade = CascadeType.DETACH,fetch = FetchType.LAZY)
    @JoinColumn(name = "sign_in_id",referencedColumnName = "sig_in_id")
    private SignInPo  signIn;

    public SignInPo getSignIn() {
        return (SignInPo) Loaded.loaded(signIn);
    }

    public void setSignIn(SignInPo signIn) {
        this.signIn = signIn;
    }



    public FlightInfoPo getFlightInfo() {
        return flightInfo;
    }

    public void setFlightInfo(FlightInfoPo flightInfo) {
        this.flightInfo = flightInfo;
    }

    public FlightPlanePo getFlightPlane() {
        return flightPlane;
    }

    public void setFlightPlane(FlightPlanePo flightPlane) {
        this.flightPlane = flightPlane;
    }

    public Boolean isHasTransformToPlane() {
        return hasTransformToPlane;
    }

    public void setHasTransformToPlane(Boolean hasTransformToPlane) {
        this.hasTransformToPlane = hasTransformToPlane;
    }

    public Date getEstimatedTime() {
        return estimatedTime;
    }

    public void setEstimatedTime(Date estimatedTime) {
        this.estimatedTime = estimatedTime;
    }

    public String getPlaneProperty() {
        return planeProperty;
    }

    public void setPlaneProperty(String planeProperty) {
        this.planeProperty = planeProperty;
    }



    public FlightPlanePo getPreFlightPlane() {
        return preFlightPlane;
    }

    public void setPreFlightPlane(FlightPlanePo preFlightPlane) {
        this.preFlightPlane = preFlightPlane;
    }

    public Boolean getEffective() {
        return effective;
    }

    public void setEffective(Boolean effective) {
        this.effective = effective;
    }


    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }
}
